Limit the length of the text the user may type into the edit control of a combo box
#Include <GuiCombo.au3>
_GUICtrlComboLimitText($h_combobox[, $i_limit=0])
Parameters
$h_combobox | control id/control hWnd |
$i_limit | Optional: Specifies the maximum number of characters the user can enter |
Return Value
None.
Remarks
If the $i_limit parameter is zero, the text length is limited to 0x7FFFFFFE characters.
Related
None.
Example
#include <GuiConstants.au3>
#include <GuiCombo.au3>
Opt('MustDeclareVars',1)
Dim $Combo,$Btn_Exit,$msg
GuiCreate("ComboBox Limit Text", 392, 254)
$Combo = GuiCtrlCreateCombo("", 70, 100, 270, 100,$CBS_SIMPLE)
GUICtrlSetData($Combo,"A|B|C|D|E|F")
_GUICtrlComboLimitText($Combo,10)
$Btn_Exit = GuiCtrlCreateButton("Exit", 150, 200, 90, 30)
GuiSetState()
While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
ExitLoop
EndSelect
WEnd
Exit